echo "********************************************************************"
echo "*"
echo "*  You will be asked for a passphrase below in the creation of a key"
echo "* "
echo "*  ====> DO NOT FORGET THIS KEY <====="
echo "* "
echo "*  You will need it many more times during this process"
echo "*"
echo "********************************************************************"
echo ""
openssl genrsa -des3 -out server.key 1024
echo ""
echo ""
echo "********************************************************************"
echo "*"
echo "*  You will be asked a series of questions below, most of which are obvious"
echo "*  The important question will look like:"
echo "*  "
echo "*  Common Name (eg, YOUR name) []: "
echo "* "
echo "* For common name, you will need to enter the domain name your server is using"
echo "* For example, if you are using the hostname localdev.com on your webserver,"
echo "* you should enter localdev.com here"
echo "********************************************************************"
openssl req -new -key server.key -out server.csr
openssl genrsa -des3 -out ca.key 1024
echo ""
echo "********************************************************************"
echo "* "
echo "* Be sure to enter the Common Name as a normal contact name this time"
echo "* "
echo "********************************************************************"
echo ""
openssl req -new -x509 -days 1365 -key ca.key -out ca.crt
./sign.sh server.csr
cp server.key server.key.original
openssl rsa -in server.key.original -out server.key
